﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace BesAsm.Stormwater.HspfCore
{
  public class LandSegmentsCollection : KeyedCollection<int, ILandSegment>
  {
    protected override int GetKeyForItem(ILandSegment item)
    {
      return item.SegmentNumber;
    }

    public ILandSegment TryAdd(ILandSegment item)
    {
      if (!this.Contains(item.SegmentNumber))
        this.Add(item);

      return (this[item.SegmentNumber]);
    }
  }
}
